﻿/*
 * More details: see rss 2.0 rfc http://cyber.law.harvard.edu/rss/rss.html
 * 
 */

using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace SNSpirit.Domain.Rss
{
    [Serializable]
    [XmlRoot(ElementName = "rssCollection", Namespace = DomainUtillity.Namespace)]
    public class RssChannel : DomainEntity
    {
        public RssChannel()
        {
            this.Items = new List<RssItem>();
        }
        /// <summary>
        /// Title
        /// </summary>
        [XmlAttribute(AttributeName = "title", Namespace = DomainUtillity.Namespace)]
        public string Title { get; set; }
        /// <summary>
        /// Link
        /// </summary>
        [XmlAttribute(AttributeName = "link", Namespace = DomainUtillity.Namespace)]
        public string Link { get; set; }
        /// <summary>
        /// Desciption
        /// </summary>
        [XmlElement(ElementName = "description", Namespace = DomainUtillity.Namespace)]
        public object Description { get; set; }
        /// <summary>
        /// Language
        /// </summary>
        [XmlAttribute(AttributeName = "language", Namespace = DomainUtillity.Namespace)]
        public string Language { get; set; }
        /// <summary>
        /// Copyright
        /// </summary>
        [XmlAttribute(AttributeName = "copyright", Namespace = DomainUtillity.Namespace)]
        public string Copyright { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "managingEditor", Namespace = DomainUtillity.Namespace)]
        public string ManagingEditor { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "webMaster", Namespace = DomainUtillity.Namespace)]
        public string WebMaster { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "publishDate", Namespace = DomainUtillity.Namespace)]
        public DateTime PublishDate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "lastBuildDate", Namespace = DomainUtillity.Namespace)]
        public DateTime LastBuildDate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "category", Namespace = DomainUtillity.Namespace)]
        public string Category { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "generator", Namespace = DomainUtillity.Namespace)]
        public string Generator { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "documents", Namespace = DomainUtillity.Namespace)]
        public Uri Documents { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "cloud", Namespace = DomainUtillity.Namespace)]
        public RssCloud Cloud { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "timeToLive", Namespace = DomainUtillity.Namespace)]
        public TimeSpan TimeToLive { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "image", Namespace = DomainUtillity.Namespace)]
        public RssImage Image { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "rating", Namespace = DomainUtillity.Namespace)]
        public string Rating { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "textInput", Namespace = DomainUtillity.Namespace)]
        public RssTextInput TextInput { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "skipHours", Namespace = DomainUtillity.Namespace)]
        public int[] SkipHours { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [XmlAttribute(AttributeName = "skipDates", Namespace = DomainUtillity.Namespace)]
        public DayOfWeek[] SkipDatas { get; set; }
        /// <summary>
        /// Rss items
        /// </summary>
        [XmlElement(ElementName = "items", Namespace = DomainUtillity.Namespace)]
        public List<RssItem> Items { get; private set; }
    }
}
